﻿<template>
  <WfPagedTable
    :table-type="tableType"
    :scheme-id="schemeId"
    :entity-name="entityName"
    :dialog-enity.sync="entity"
    :request-param="pagerequest"
    :keyword-placeholder="keywordPlaceholder"
    :dialog-optins="dialogOptins"
    @dialogFormClearValidate="handleFormClearValidate"
    @dialogFormValidate="handleFormValidate"
  >
    <template slot="FilterItems" />

    <template slot="TableColumns">

      <el-table-column
        prop="no"
        label="请假单号"
      />
      <el-table-column
        prop="applyUserName"
        label="申请人员"
      />
      <el-table-column
        prop="beginTime"
        label="开始时间"
      >
        <template slot-scope="{row}">
          <span>{{ row.beginTime | parseTime('{y}-{m}-{d} {h}:{i}:{s}') }}</span>
        </template>
      </el-table-column>
      <el-table-column
        prop="endTime"
        label="结束时间"
      >
        <template slot-scope="{row}">
          <span>{{ row.endTime | parseTime('{y}-{m}-{d} {h}:{i}:{s}') }}</span>
        </template>
      </el-table-column>
      <el-table-column
        prop="timeDuration"
        label="请假时长"
      />
      <el-table-column
        prop="leaveReqForm.applyTime"
        sortable="custom"
        label="申请时间"
      >
        <template slot-scope="{row}">
          <span>{{ row.applyTime | parseTime('{y}-{m}-{d} {h}:{i}:{s}') }}</span>
        </template>
      </el-table-column>
    </template>

    <applyOrVerificationLeaveReqForm
      ref="ApplyOrVerificationForm"
      slot="ApplyOrVerificationForm"
      slot-scope="{rdn,dialogAction,activityName,isActiveNode,isActiveNo}"
      :rdn="rdn"
      :activity-name="activityName"
      :dialog-action="dialogAction"
      :is-active-node="isActiveNode"
      :is-active-no="isActiveNo"
      :entity="entity"
    />
  </WfPagedTable>
</template>
<script>
import WfPagedTable from '@/components/WorkFlow/WfPagedTable'
import applyOrVerificationLeaveReqForm from '../components/ApplyOrVerificationLeaveReqForm'
export default {
  name: 'LeaveReqForm',
  components: { WfPagedTable, applyOrVerificationLeaveReqForm },
  data() {
    return {
      tableType: 'mine',
      schemeId: '432c4ef6-6ecc-454e-30c2-08d77992acf4', // 流程模型Id
      entity: {},
      entityName: 'leaveReqForm',
      pagerequest: null,
      keywordPlaceholder: '请假单号',
      dialogOptins: {
        createEnityParam: { timeDuration: 0 },
        deleteConfirm: this.L('Delete')
      }
    }
  },
  methods: {
    handleFormClearValidate() {
      this.$refs.ApplyOrVerificationForm.clearValidate()
    },
    handleFormValidate(cb) {
      this.$refs.ApplyOrVerificationForm.validate(cb)
    }
  }

}

</script>
